<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>会员列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.6.0.js"></script>
</head>
<style>
</style>
<body>
<jsp:include   page="menu.jsp" flush="true"/>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>会员列表</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/member/toAddMember">新增会员</a>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/member/allMember">显示所有会员</a>
        </div>
        <div class="col-md-4 column">

        </div>
        <div class="col-md-4 column" style="float: right">
            <form action="${pageContext.request.contextPath}/member/queryMember" method="post" class="form-inline">
                <input type="text" name="queryMemberName" class="form-control" placeholder="请输入要查询的会员名称">
                <input type="submit" value="提交" class="btn btn-primary">
            </form>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>会员编号</th>
                    <th>会员名字</th>
                    <th>身份证号</th>
                    <th>性别</th>
                    <th>密码</th>
                    <th>手机号码</th>
                    <th>网费</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="member" items="${list}">
                    <tr>
                        <td>${member.getMemberID()}</td>
                        <td>${member.getMemberName()}</td>
                        <td>${member.getMemberNo()}</td>
                        <td>${member.getMemberGender()}</td>
                        <td>${member.getMemberPwd()}</td>
                        <td>${member.getMemberMobile()}</td>
                        <td>${member.getMemberCost()}</td>
                        <td>
                            <span style="color: red;font-weight: bold">${error}</span>
                            <a href="${pageContext.request.contextPath}/member/toUpdateMember?id=${member.getMemberID()}">充值</a> |
                            <a href="${pageContext.request.contextPath}/member/del/${member.getMemberID()}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>

            </table>
        </div>
    </div>

</div>
</body>
</html>
